<input type="text" id="input">
<button onclick="send()">send</button>
<pre id="output"></pre>
<script>
    var input = document.getElementById("input")
    var output = document.getElementById("output")
    var socket = new WebSocket("ws://localhost:8989/echo")


    socket.onopen = () => {
        output.innerHTML += "Status: Connnected\n";
    }

    socket.onmessage = e => {
        output.innerHTML += `Server ${e.data} \n`
    }

    function send() {
        socket.send(input.value)
        input.value = ''
    }
</script>